3.3.33 \(\int (f+g x) (A+B \log (\frac {e (a+b x)}{c+d x})) \, dx\) [233]
Optimal. Leaf size=109 \[ -\frac {B (b c-a d) g x}{2 b d}-\frac {B (b f-a g)^2 \log (a+b x)}{2 b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 g}+\frac {B (d f-c g)^2 \log (c+d x)}{2 d^2 g} \]
[Out]
-1/2*B*(-a*d+b*c)*g*x/b/d-1/2*B*(-a*g+b*f)^2*ln(b*x+a)/b^2/g+1/2*(g*x+f)^2*(A+B*ln(e*(b*x+a)/(d*x+c)))/g+1/2*B
*(-c*g+d*f)^2*ln(d*x+c)/d^2/g
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {2548, 84}
\begin {gather*} \frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )}{2 g}-\frac {B (b f-a g)^2 \log (a+b x)}{2 b^2 g}-\frac {B g x (b c-a d)}{2 b d}+\frac {B (d f-c g)^2 \log (c+d x)}{2 d^2 g} \end {gather*}
Antiderivative was successfully verified.
[In]
Int[(f + g*x)*(A + B*Log[(e*(a + b*x))/(c + d*x)]),x]
[Out]
-1/2*(B*(b*c - a*d)*g*x)/(b*d) - (B*(b*f - a*g)^2*Log[a + b*x])/(2*b^2*g) + ((f + g*x)^2*(A + B*Log[(e*(a + b*
x))/(c + d*x)]))/(2*g) + (B*(d*f - c*g)^2*Log[c + d*x])/(2*d^2*g)
Rule 84
Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]
Rule 2548
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_)]*(B_.))*((f_.) + (g_.)*(x_))^(m_.
), x_Symbol] :> Simp[(f + g*x)^(m + 1)*((A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/(g*(m + 1))), x] - Dist[B*n*(
(b*c - a*d)/(g*(m + 1))), Int[(f + g*x)^(m + 1)/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, A
, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && NeQ[m, -1] && !(EqQ[m, -2] && IntegerQ[n])
Rubi steps
\begin {align*} \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \, dx &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 g}-\frac {B \int \frac {(b c-a d) (f+g x)^2}{(a+b x) (c+d x)} \, dx}{2 g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 g}-\frac {(B (b c-a d)) \int \frac {(f+g x)^2}{(a+b x) (c+d x)} \, dx}{2 g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 g}-\frac {(B (b c-a d)) \int \left (\frac {g^2}{b d}+\frac {(b f-a g)^2}{b (b c-a d) (a+b x)}+\frac {(d f-c g)^2}{d (-b c+a d) (c+d x)}\right ) \, dx}{2 g}\\ &=-\frac {B (b c-a d) g x}{2 b d}-\frac {B (b f-a g)^2 \log (a+b x)}{2 b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{2 g}+\frac {B (d f-c g)^2 \log (c+d x)}{2 d^2 g}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 114, normalized size = 1.05 \begin {gather*} \frac {-B d^2 (b f-a g)^2 \log (a+b x)+b \left (d \left (B (-b c+a d) g^2 x+A b d (f+g x)^2\right )+b B d^2 (f+g x)^2 \log \left (\frac {e (a+b x)}{c+d x}\right )+b B (d f-c g)^2 \log (c+d x)\right )}{2 b^2 d^2 g} \end {gather*}
Antiderivative was successfully verified.
[In]
Integrate[(f + g*x)*(A + B*Log[(e*(a + b*x))/(c + d*x)]),x]
[Out]
(-(B*d^2*(b*f - a*g)^2*Log[a + b*x]) + b*(d*(B*(-(b*c) + a*d)*g^2*x + A*b*d*(f + g*x)^2) + b*B*d^2*(f + g*x)^2
*Log[(e*(a + b*x))/(c + d*x)] + b*B*(d*f - c*g)^2*Log[c + d*x]))/(2*b^2*d^2*g)
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(963\) vs.
\(2(101)=202\).
time = 0.38, size = 964, normalized size = 8.84 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((g*x+f)*(A+B*ln(e*(b*x+a)/(d*x+c))),x,method=_RETURNVERBOSE)
[Out]
-1/d^2*e*(a*d-b*c)*(-A*d^2*(1/2*e*g*(a*d-b*c)/d^2/(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)^2+(c*g-d*f)/d^2/(b*e-(
b*e/d+(a*d-b*c)*e/d/(d*x+c))*d))-1/2*B*d/e*g/b^2*ln(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)*a-1/2*B/e*g/b*ln(b*e-
(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)*c+1/2*B*d*g/b/(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)*a-1/2*B*g/(b*e-(b*e/d+(a*
d-b*c)*e/d/(d*x+c))*d)*c-B*d^2*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))*(b*e/d+(a*d-b*c)*e/d/(d*x+c))/b/(b*e-(b*e/d+(
a*d-b*c)*e/d/(d*x+c))*d)^2*a+B*d*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))*(b*e/d+(a*d-b*c)*e/d/(d*x+c))/(b*e-(b*e/d+(
a*d-b*c)*e/d/(d*x+c))*d)^2*c+1/2*B*d^3/e*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))*(b*e/d+(a*d-b*c)*e/d/(d*x+c))^2/b^2
/(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)^2*a-1/2*B*d^2/e*g*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))*(b*e/d+(a*d-b*c)*e/d/
(d*x+c))^2/b/(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)^2*c+B*d/b/e*ln(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)*f-B*d*l
n(b*e/d+(a*d-b*c)*e/d/(d*x+c))*(b*e/d+(a*d-b*c)*e/d/(d*x+c))/b/e/(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)*c*g+B*d
^2*ln(b*e/d+(a*d-b*c)*e/d/(d*x+c))*(b*e/d+(a*d-b*c)*e/d/(d*x+c))/b/e/(b*e-(b*e/d+(a*d-b*c)*e/d/(d*x+c))*d)*f)
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 144, normalized size = 1.32 \begin {gather*} \frac {1}{2} \, A g x^{2} + {\left (x \log \left (\frac {b x e}{d x + c} + \frac {a e}{d x + c}\right ) + \frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} B f + \frac {1}{2} \, {\left (x^{2} \log \left (\frac {b x e}{d x + c} + \frac {a e}{d x + c}\right ) - \frac {a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {{\left (b c - a d\right )} x}{b d}\right )} B g + A f x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)*(A+B*log(e*(b*x+a)/(d*x+c))),x, algorithm="maxima")
[Out]
1/2*A*g*x^2 + (x*log(b*x*e/(d*x + c) + a*e/(d*x + c)) + a*log(b*x + a)/b - c*log(d*x + c)/d)*B*f + 1/2*(x^2*lo
g(b*x*e/(d*x + c) + a*e/(d*x + c)) - a^2*log(b*x + a)/b^2 + c^2*log(d*x + c)/d^2 - (b*c - a*d)*x/(b*d))*B*g +
A*f*x
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 149, normalized size = 1.37 \begin {gather*} \frac {A b^{2} d^{2} g x^{2} + {\left (2 \, A b^{2} d^{2} f - {\left (B b^{2} c d - B a b d^{2}\right )} g\right )} x + {\left (2 \, B a b d^{2} f - B a^{2} d^{2} g\right )} \log \left (b x + a\right ) - {\left (2 \, B b^{2} c d f - B b^{2} c^{2} g\right )} \log \left (d x + c\right ) + {\left (B b^{2} d^{2} g x^{2} + 2 \, B b^{2} d^{2} f x\right )} \log \left (\frac {{\left (b x + a\right )} e}{d x + c}\right )}{2 \, b^{2} d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)*(A+B*log(e*(b*x+a)/(d*x+c))),x, algorithm="fricas")
[Out]
1/2*(A*b^2*d^2*g*x^2 + (2*A*b^2*d^2*f - (B*b^2*c*d - B*a*b*d^2)*g)*x + (2*B*a*b*d^2*f - B*a^2*d^2*g)*log(b*x +
a) - (2*B*b^2*c*d*f - B*b^2*c^2*g)*log(d*x + c) + (B*b^2*d^2*g*x^2 + 2*B*b^2*d^2*f*x)*log((b*x + a)*e/(d*x +
c)))/(b^2*d^2)
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 318 vs.
\(2 (90) = 180\).
time = 3.38, size = 318, normalized size = 2.92 \begin {gather*} \frac {A g x^{2}}{2} - \frac {B a \left (a g - 2 b f\right ) \log {\left (x + \frac {B a^{2} c d g + \frac {B a^{2} d^{2} \left (a g - 2 b f\right )}{b} + B a b c^{2} g - 4 B a b c d f - B a c d \left (a g - 2 b f\right )}{B a^{2} d^{2} g - 2 B a b d^{2} f + B b^{2} c^{2} g - 2 B b^{2} c d f} \right )}}{2 b^{2}} + \frac {B c \left (c g - 2 d f\right ) \log {\left (x + \frac {B a^{2} c d g + B a b c^{2} g - 4 B a b c d f - B a b c \left (c g - 2 d f\right ) + \frac {B b^{2} c^{2} \left (c g - 2 d f\right )}{d}}{B a^{2} d^{2} g - 2 B a b d^{2} f + B b^{2} c^{2} g - 2 B b^{2} c d f} \right )}}{2 d^{2}} + x \left (A f + \frac {B a g}{2 b} - \frac {B c g}{2 d}\right ) + \left (B f x + \frac {B g x^{2}}{2}\right ) \log {\left (\frac {e \left (a + b x\right )}{c + d x} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)*(A+B*ln(e*(b*x+a)/(d*x+c))),x)
[Out]
A*g*x**2/2 - B*a*(a*g - 2*b*f)*log(x + (B*a**2*c*d*g + B*a**2*d**2*(a*g - 2*b*f)/b + B*a*b*c**2*g - 4*B*a*b*c*
d*f - B*a*c*d*(a*g - 2*b*f))/(B*a**2*d**2*g - 2*B*a*b*d**2*f + B*b**2*c**2*g - 2*B*b**2*c*d*f))/(2*b**2) + B*c
*(c*g - 2*d*f)*log(x + (B*a**2*c*d*g + B*a*b*c**2*g - 4*B*a*b*c*d*f - B*a*b*c*(c*g - 2*d*f) + B*b**2*c**2*(c*g
- 2*d*f)/d)/(B*a**2*d**2*g - 2*B*a*b*d**2*f + B*b**2*c**2*g - 2*B*b**2*c*d*f))/(2*d**2) + x*(A*f + B*a*g/(2*b
) - B*c*g/(2*d)) + (B*f*x + B*g*x**2/2)*log(e*(a + b*x)/(c + d*x))
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 2355 vs.
\(2 (102) = 204\).
time = 3.55, size = 2355, normalized size = 21.61 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((g*x+f)*(A+B*log(e*(b*x+a)/(d*x+c))),x, algorithm="giac")
[Out]
1/2*(2*B*b^5*c^2*d*f*e^3*log(-b*e + (b*x*e + a*e)*d/(d*x + c)) - 4*B*a*b^4*c*d^2*f*e^3*log(-b*e + (b*x*e + a*e
)*d/(d*x + c)) + 2*B*a^2*b^3*d^3*f*e^3*log(-b*e + (b*x*e + a*e)*d/(d*x + c)) - B*b^5*c^3*g*e^3*log(-b*e + (b*x
*e + a*e)*d/(d*x + c)) + B*a*b^4*c^2*d*g*e^3*log(-b*e + (b*x*e + a*e)*d/(d*x + c)) + B*a^2*b^3*c*d^2*g*e^3*log
(-b*e + (b*x*e + a*e)*d/(d*x + c)) - B*a^3*b^2*d^3*g*e^3*log(-b*e + (b*x*e + a*e)*d/(d*x + c)) - 4*(b*x*e + a*
e)*B*b^4*c^2*d^2*f*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) + 8*(b*x*e + a*e)*B*a*b^3*c*d^3*f*e^2*l
og(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) - 4*(b*x*e + a*e)*B*a^2*b^2*d^4*f*e^2*log(-b*e + (b*x*e + a*e)*
d/(d*x + c))/(d*x + c) + 2*(b*x*e + a*e)*B*b^4*c^3*d*g*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) - 2
*(b*x*e + a*e)*B*a*b^3*c^2*d^2*g*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) - 2*(b*x*e + a*e)*B*a^2*b
^2*c*d^3*g*e^2*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c) + 2*(b*x*e + a*e)*B*a^3*b*d^4*g*e^2*log(-b*e +
(b*x*e + a*e)*d/(d*x + c))/(d*x + c) + 2*(b*x*e + a*e)^2*B*b^3*c^2*d^3*f*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c
))/(d*x + c)^2 - 4*(b*x*e + a*e)^2*B*a*b^2*c*d^4*f*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 + 2*(b*
x*e + a*e)^2*B*a^2*b*d^5*f*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 - (b*x*e + a*e)^2*B*b^3*c^3*d^2
*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 + (b*x*e + a*e)^2*B*a*b^2*c^2*d^3*g*e*log(-b*e + (b*x*e
+ a*e)*d/(d*x + c))/(d*x + c)^2 + (b*x*e + a*e)^2*B*a^2*b*c*d^4*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*
x + c)^2 - (b*x*e + a*e)^2*B*a^3*d^5*g*e*log(-b*e + (b*x*e + a*e)*d/(d*x + c))/(d*x + c)^2 + 2*(b*x*e + a*e)*B
*b^4*c^2*d^2*f*e^2*log((b*x*e + a*e)/(d*x + c))/(d*x + c) - 4*(b*x*e + a*e)*B*a*b^3*c*d^3*f*e^2*log((b*x*e + a
*e)/(d*x + c))/(d*x + c) + 2*(b*x*e + a*e)*B*a^2*b^2*d^4*f*e^2*log((b*x*e + a*e)/(d*x + c))/(d*x + c) - 2*(b*x
*e + a*e)*B*a*b^3*c^2*d^2*g*e^2*log((b*x*e + a*e)/(d*x + c))/(d*x + c) + 4*(b*x*e + a*e)*B*a^2*b^2*c*d^3*g*e^2
*log((b*x*e + a*e)/(d*x + c))/(d*x + c) - 2*(b*x*e + a*e)*B*a^3*b*d^4*g*e^2*log((b*x*e + a*e)/(d*x + c))/(d*x
+ c) - 2*(b*x*e + a*e)^2*B*b^3*c^2*d^3*f*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 + 4*(b*x*e + a*e)^2*B*a*b^
2*c*d^4*f*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 - 2*(b*x*e + a*e)^2*B*a^2*b*d^5*f*e*log((b*x*e + a*e)/(d*
x + c))/(d*x + c)^2 + (b*x*e + a*e)^2*B*b^3*c^3*d^2*g*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 - (b*x*e + a*
e)^2*B*a*b^2*c^2*d^3*g*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 - (b*x*e + a*e)^2*B*a^2*b*c*d^4*g*e*log((b*x
*e + a*e)/(d*x + c))/(d*x + c)^2 + (b*x*e + a*e)^2*B*a^3*d^5*g*e*log((b*x*e + a*e)/(d*x + c))/(d*x + c)^2 + 2*
A*b^5*c^2*d*f*e^3 - 4*A*a*b^4*c*d^2*f*e^3 + 2*A*a^2*b^3*d^3*f*e^3 - A*b^5*c^3*g*e^3 - B*b^5*c^3*g*e^3 + A*a*b^
4*c^2*d*g*e^3 + 3*B*a*b^4*c^2*d*g*e^3 + A*a^2*b^3*c*d^2*g*e^3 - 3*B*a^2*b^3*c*d^2*g*e^3 - A*a^3*b^2*d^3*g*e^3
+ B*a^3*b^2*d^3*g*e^3 - 2*(b*x*e + a*e)*A*b^4*c^2*d^2*f*e^2/(d*x + c) + 4*(b*x*e + a*e)*A*a*b^3*c*d^3*f*e^2/(d
*x + c) - 2*(b*x*e + a*e)*A*a^2*b^2*d^4*f*e^2/(d*x + c) + 2*(b*x*e + a*e)*A*b^4*c^3*d*g*e^2/(d*x + c) + (b*x*e
+ a*e)*B*b^4*c^3*d*g*e^2/(d*x + c) - 4*(b*x*e + a*e)*A*a*b^3*c^2*d^2*g*e^2/(d*x + c) - 3*(b*x*e + a*e)*B*a*b^
3*c^2*d^2*g*e^2/(d*x + c) + 2*(b*x*e + a*e)*A*a^2*b^2*c*d^3*g*e^2/(d*x + c) + 3*(b*x*e + a*e)*B*a^2*b^2*c*d^3*
g*e^2/(d*x + c) - (b*x*e + a*e)*B*a^3*b*d^4*g*e^2/(d*x + c))*(b*c/((b*c*e - a*d*e)*(b*c - a*d)) - a*d/((b*c*e
- a*d*e)*(b*c - a*d)))/(b^4*d^2*e^2 - 2*(b*x*e + a*e)*b^3*d^3*e/(d*x + c) + (b*x*e + a*e)^2*b^2*d^4/(d*x + c)^
2)
________________________________________________________________________________________
Mupad [B]
time = 4.24, size = 144, normalized size = 1.32 \begin {gather*} \ln \left (\frac {e\,\left (a+b\,x\right )}{c+d\,x}\right )\,\left (\frac {B\,g\,x^2}{2}+B\,f\,x\right )+x\,\left (\frac {2\,A\,a\,d\,g+2\,A\,b\,c\,g+2\,A\,b\,d\,f+B\,a\,d\,g-B\,b\,c\,g}{2\,b\,d}-\frac {A\,g\,\left (2\,a\,d+2\,b\,c\right )}{2\,b\,d}\right )-\frac {\ln \left (a+b\,x\right )\,\left (B\,a^2\,g-2\,B\,a\,b\,f\right )}{2\,b^2}+\frac {\ln \left (c+d\,x\right )\,\left (B\,c^2\,g-2\,B\,c\,d\,f\right )}{2\,d^2}+\frac {A\,g\,x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((f + g*x)*(A + B*log((e*(a + b*x))/(c + d*x))),x)
[Out]
log((e*(a + b*x))/(c + d*x))*(B*f*x + (B*g*x^2)/2) + x*((2*A*a*d*g + 2*A*b*c*g + 2*A*b*d*f + B*a*d*g - B*b*c*g
)/(2*b*d) - (A*g*(2*a*d + 2*b*c))/(2*b*d)) - (log(a + b*x)*(B*a^2*g - 2*B*a*b*f))/(2*b^2) + (log(c + d*x)*(B*c
^2*g - 2*B*c*d*f))/(2*d^2) + (A*g*x^2)/2
________________________________________________________________________________________